<template>
	<view class="container">
		<image class="banner" :src="registerTop" mode=""></image>
		<view class="idea">
			<view class="idea-item">
				<image class="item-img"  src="http://ganor.oss-cn-shanghai.aliyuncs.com/option/1.png" mode=""></image>
				<text class="item-title">国际托育理念</text>
				<text class="item-disc">国际接轨，引进国际先进托育观念</text>
			</view>
			<view class="idea-item">
				<image class="item-img" src="http://ganor.oss-cn-shanghai.aliyuncs.com/option/2.png" mode=""></image>
				<text class="item-title">0～3分龄教材</text>
				<text class="item-disc">针对0到3岁宝宝生长发育特点，定制分龄教程教具包</text>
			</view>
			<view class="idea-item">
				<image class="item-img"  src="http://ganor.oss-cn-shanghai.aliyuncs.com/option/3.png" mode=""></image>
				<text  class="item-title">专家团队本土落地</text>
				<text class="item-disc">团队成员超20年托育经验</text>
			</view>
		</view>
		<!-- <view class="advantage">
			<text class="advantage-title">GANOR Internetional Infant Center</text>
			<text class="advantage-subtitle"> GANOR 佳诺国际婴幼中心</text>
		</view> -->
		<view class="option">
			<view class="option-item">
				<image class="option-img" src="http://ganor.oss-cn-shanghai.aliyuncs.com/banner/banner1.png"></image>
				<text class="option-title">个性精细化服务</text>
				<text >.家校App</text>
				<text>.智能穿戴</text>
				<text>.24小时高清监控</text>
			</view>
			<view class="option-item">
				<image class="option-img" src="http://ganor.oss-cn-shanghai.aliyuncs.com/banner/banner2.png"></image>
				<text class="option-title">一站式服务</text>
				<text  >.小儿推拿</text>
				<text>.水育</text>
				<text>.亲子早教</text>
			</view>
			<view class="option-item">
				<image class="option-img" src="http://ganor.oss-cn-shanghai.aliyuncs.com/banner/banner3.png"></image>
				<text class="option-title">高品质教具</text>
				<text>.国外进口教材材料</text>
				<text>.研发专业分龄教材</text>
				<text>.儿童教具清洁消毒</text>
			</view>
			<view class="option-item">
				<image class="option-img" src="http://ganor.oss-cn-shanghai.aliyuncs.com/banner/banner4.png"></image>
				<text class="option-title">科技智能化环境</text>
				<text>.新风系统</text>
				<text>.水质系统</text>
				<text>.安保系统</text>
			</view>
		</view>
		<view class="care">
			<view class="care-title"><text>—</text> <text>全日制托育</text> <text>—</text></view>
			<view class="care-subtitle"><text>早教中心机构</text> <text class="vs">VS</text> <text>佳诺BABY之家</text></view>
			<view class="care-option">
				<view class="care-option-left ">
					<view class="care-option-item black">
						<i class='iconfont'>&#xe613;</i>
						<text class="item-content">没有托婴儿服务宝宝需满足3岁</text>
					</view>
					<view class="care-option-item black">
						<i class='iconfont'>&#xe613;</i>
						<text class="item-content">没有专门的婴儿成长教室环境</text>
					</view>
					<view class="care-option-item black">
						<i class='iconfont'>&#xe613;</i>
						<text class="item-content">无午餐点心</text>
					</view>
					<view class="care-option-item black">
						<i class='iconfont'>&#xe613;</i>
						<text class="item-content">无每月主题亲子活动</text>
					</view>
					<view class="care-option-item black">
						<i class='iconfont'>&#xe613;</i>
						<text class="item-content">无外语文化活动</text>
					</view>
				</view>
				<view class="care-option-right ">
					<view class="care-option-item red">
						<i class='iconfont'>&#xe610;</i>
						<text class="item-content">专业教室保育师即逆行婴童托育照顾</text>
					</view>
					<view class="care-option-item red">
						<i class='iconfont'>&#xe610;</i>
						<text class="item-content">满足宝宝成长天性营造所需环境</text>
					</view>
					<view class="care-option-item red">
						<i class='iconfont'>&#xe610;</i>
						<text class="item-content">专门设计宝宝餐点培养独立进餐习惯</text>
					</view>
					<view class="care-option-item red">
						<i class='iconfont'>&#xe610;</i>
						<text class="item-content">每月组织丰富的亲子活动</text>
					</view>
					<view class="care-option-item red">
						<i class='iconfont'>&#xe610;</i>
						<text class="item-content">让宝宝感受国际文化熏陶</text>
					</view>
				</view>
			</view>
		</view>
		<view class="timetable">
			<view class="timetable-item">
				<view class="timetable-title">
					<text>DAILY SCHEDULE</text>
					<text>每日课程安排</text>
				</view>
				<view class="timetable-content">
					<view class="timetable-subtitle">
						<i class='iconfont'></i>
						Morning 上午 (课程)
					</view>
					<view class="course-item">
						<text class="course-item-time">8:00am.to9:00am</text>
						<text class="course-item-en">Morming Recepition</text>
						<text class="course-item-name">哈罗空间 :基本照护/自我料理/自我生活 </text>
					</view>
			
					<view class="course-item">
						<text class="course-item-time">9:00am.to9:20am</text>
						<text class="course-item-en">Learing inquiry Activity</text>
						<text class="course-item-name">学习探究活动 </text>
					</view>
					<view class="course-item">
						<text class="course-item-time">9:30am.to10:00am</text>
						<text class="course-item-en">Morming Exercise/Fruit Saiad</text>
						<text class="course-item-name">课间操/点心</text>
					</view>
					<view class="course-item">
						<text class="course-item-time">10:10am.to11:10am</text>
						<text class="course-item-en">Work Regional/Activities</text>
						<text class="course-item-name">VLH 工作/区域自选活动 </text>
					</view>
					<view class="course-item">
						<text class="course-item-time">11:20am.to12:00am</text>
						<text class="course-item-en">Lunch Time</text>
						<text class="course-item-name">丰富午餐 及良好用餐习惯培养 餐后散步 </text>
					</view>
				</view>
				
		
			</view>
			<view class="timetable-item">
				<view class="timetable-title">
					<text>DAILY SCHEDULE</text>
					<text>每日课程安排</text>
				</view>
				<view class="timetable-content">
					<view class="timetable-subtitle">
						<i class='iconfont'></i>
						Afternoon 下午 (课程)
					</view>
						<view class="course-item">
							<text class="course-item-time">14:30pm.to15:00pm</text>
							<text class="course-item-en">Get-up Time</text>
							<text class="course-item-name">起床时间!基本照护/自我料理</text>
						</view>
						<view class="course-item">
							<text class="course-item-time">15:00pm.to15:30pm</text>
							<text class="course-item-en">Dessert Time</text>
							<text class="course-item-name">牛奶点心餐 </text>
						</view>
						<view class="course-item">
							<text class="course-item-time">16:30pm.to16:30pm</text>
							<text class="course-item-en">Game Time </text>
							<text class="course-item-name">游戏时间 基本照护/自我料理 </text>
						</view>
						<!-- <view class="course-item">
							<text class="course-item-time">8:00am.to9:00am</text>
							<text class="course-item-en">Morming Recepition</text>
							<text class="course-item-name">基本照护/自我料理/自我生活 </text>
						</view> -->
						<view class="course-item">
							<text class="course-item-time">16:30pm.to17:30pm</text>
							<text class="course-item-en">Leaving Activities</text>
							<text class="course-item-name">集体游戏和离园基本照护/自我料理 </text>
						</view>
				</view>
			</view>
		</view>
		<view class="timetable-bottom">
			<view class="timetable-bottom-item">
				<view class="bottom-item" style="background: red;">
					<text class="bottom-item-time">12:00am.to14:30pm</text>
					<text class="bottom-item-en">Nap Time</text>
					<text class="bottome-item-name">甜蜜午休 基本照护/自我料理 </text>
				</view>
			</view>
			<image style=" height: 200rpx;" src="http://ganor.oss-cn-shanghai.aliyuncs.com/banner/timetable.png" mode=""></image>
		</view>
		<view class="environment">
			<view class="environment-title">校区环境</view>
			<image class="environment-banner" :src="registerMid"></image>
		</view>
		<view class="apply">
			<view class="apply-title">宝贝申请</view>
			<form @submit="formSubmit" @reset="formReset">
				<view class="form-item">
					<view class="title">家长姓名:</view>
					<input class="uni-input" v-model="form.member_name" />
				</view>
				<view class="form-item">
					<view class="title">联系方式:</view>
					<input class="uni-input" v-model="form.customer_mobile" />
				</view>
				<view class="form-item">
					<view class="title">宝贝姓名:</view>
					<input class="uni-input" v-model="form.customer_name" />
				</view>
				<view class="form-item">
					<view class="title">宝贝生日:</view>
					<picker class="uni-input" mode="date" :value="form.birthday" start="2010-01-01" end="2099-12-31" @change="bindDateChange">
						<view class="uni-input">{{form.birthday}}</view>
					</picker>
				</view>
				<!-- <view class="form-item">
					<view class="title">校区选址:</view>
					<picker @change="bindPickerChange" :value="index" :range="array">
						<view class="form-item-select">
							<text>{{array[index]}}</text>
							<i class='iconfont'>&#xe62b;</i>
						</view>
						
					</picker>
				</view> -->
				<view class="submit" @tap="register">提交申请</view>
			</form>
		</view>
		<view class="footer">
			<image class="footer-img" :src="registerBottom" mode=""></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form:{
					open_id:'',
					member_name :'',
					customer_name:'',
					customer_mobile:'',
					birthday:''
				},
				userInfo:{},
				registerTop:this.config.DEFAULT_REGISTER_TOP,
				registerMid:this.config.DEFAULT_REGISTER_MID,
				registerBottom:this.config.DEFAULT_REGISTER_BOTTOM,
			};
		},
		onLoad() {
			this.userInfo = getApp().globalData.WXUserInfo;
			
		},
		onShow() {
		},
		methods:{
			register(){
				if(this.form.member_name.length == 0){
					uni.showToast({
						icon:'none',
						title:'请输入家长姓名'
					})
					return ;
				}
				if(this.form.customer_mobile.length == 0){
					uni.showToast({
						icon:'none',
						title:'请输入家长联系方式'
					})
					return ;
				}
				if(!(/^1[3456789]\d{9}$/.test(this.form.customer_mobile))) {
					uni.showToast({
						icon:'none',
						title:'请输入正确的手机号码'
					})
					return ;
				}
				if(this.form.customer_name.length == 0){
					uni.showToast({
						icon:'none',
						title:'请输入宝贝姓名'
					})
					return ;
				}
				if(this.form.birthday.length == 0){
					uni.showToast({
						icon:'none',
						title:'请输入宝贝生日'
					})
					return ;
				}
				console.log('userinfo',this.userInfo);
				if(!this.userInfo && !this.userInfo.open_id){
					uni.showToast({
						icon:'none',
						title:'未授权'
					})
					return ;
				}
				this.form.open_id = this.userInfo.open_id || ''
				uni.showLoading({
					title:'正在提交...'
				})
				this.common.http.request('/api/v1/auth/register/bind/customer','POST',this.form,res => {
					if(res.data.code == '10026010'){
						uni.showModal({
							content:'您已经注册,点击登陆',
							showCancel:false,
							success() {
								uni.redirectTo({
									url:'../login/login-wx'
								})
							}
						})
					}
					if(res.data.code == 0) {
						uni.showModal({
							content:'注册成功，点击进入',
							showCancel: false,
							success() {
								uni.reLaunch({
									url:'../index/index'
								})
							}
						})
					} else {
						uni.showToast({
							icon:'none',
							title:'提交申请错误：'+res.data.message
						})
					}
				})
			},
			bindDateChange(e) {
				console.log('birth',e);
				this.form.birthday = e.detail.value
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container{
		background-color: #efefef;
		font-size: 24rpx;
		.banner{
			width: 100vw;
			height: 899rpx;
		}
		.idea{
			display: flex;
			padding: 40rpx 0;
			box-sizing: border-box;
			.idea-item{
				display: flex;
				flex: 1;
				flex-direction: column;
				align-items: center;
				padding: 0 20rpx;
				box-sizing: border-box;
				.item-img{
					width: 104rpx;
					height: 104rpx;
				}
				.item-title{
					font-size:26rpx;
					font-family:PingFangSC-Regular,PingFang SC;
					font-weight:400;
					color:rgba(38,66,114,1);
					margin: 10rpx 0;
				}
				.item-disc{
					font-size:22rpx;
					font-family:PingFangSC-Regular,PingFang SC;
					text-align: center;
					font-weight:400;
					color:rgba(142,142,147,1);
				}
				&:nth-of-type(2){
					border-left:1rpx solid #979797; 
					border-right: 1rpx solid #979797;
				}
			}
		}
		.advantage{
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			.advantage-title{
				font-size: 32rpx;
				color: #264272;
				margin: 20rpx;
			}
			.advantage-subtitle{
				font-size: 24rpx;
				color: #8E8E93;
				margin: 10rpx;
			}
		}
		.option{
			padding: 10rpx;
			box-sizing: border-box;
			display: flex;
			flex-wrap: wrap;
			.option-item{
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				background: #fff;
				margin: 10rpx;
				padding-bottom: 30rpx;
				box-sizing: border-box;
				.option-img{
					width: 345rpx;
					height: 150rpx;
				}
				.option-title{
					color: rgba(155,46,59,1);
					font-size: 36rpx;
					margin: 10rpx;
				}
			}
		}
		.care{
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: column;
			margin: 60rpx auto;
			background: #fff;
			padding:  30rpx 0;
			box-sizing: border-box;
			width: 700rpx;
			height: 743rpx;
			.care-title{
				width: 100%;
				display: flex;
				justify-content: space-around;
				align-items: center;
				font-size: 40rpx;
				margin-top: 20rpx;
			}
			.care-subtitle{
				// margin: 20rpx;
				display: flex;
				.vs{
					width: 60rpx;
					height: 60rpx;
					line-height: 60rpx;
					text-align: center;
					border-radius: 50%;
					margin: 0 20rpx;
					color: #fff;
					background: red;
				}
			}
			.care-option{
				width: 100%;
				display: flex;
				padding: 10rpx;
				box-sizing: border-box;
				justify-content: space-between;
				.care-option-item{
					width: 320rpx;
					height: 100rpx;
					font-size: 30rpx;
					padding: 20rpx;
					box-sizing: border-box;
					display: flex;
					justify-content: center;
					align-items: center;
					font-size: 24rpx;
					margin: 20rpx 0;
					color: #fff;
					.item-content{
						margin-left: 30rpx;
						width: 200rpx;
					}
					&.black{
						background: rgba(75,73,76,1);
					}
					&.red{
						background-color: rgba(208,67,76,1);
					}
				}
				
			}
		}
		.timetable{
			display: flex;
			padding: 30rpx;
			box-sizing: border-box;
			background-color: #fff;
			.timetable-item{
				
			}
			.timetable-title{
				display: flex;
				flex-direction: column;
				justify-content: center;
				color: #fff;
				font-size: 36rpx;
				background: rgba(45,59,96,1);
				padding: 0 20rpx;
			}
			.timetable-content{
				display: flex;
				flex-direction: column;
				justify-content: center;
				width: 290rpx;
				.timetable-subtitle{
					font-size: 30rpx;
				}
				.course-item{
					height: 120rpx;
					margin: 20rpx 0;
					display: flex;
					flex-direction: column;
					justify-content: center;
					align-items: flex-start;
					.course-item-time{
						font-size: 26rpx;
					}
					.course-item-en{
						font-size: 20rpx;
					}
					.course-item-name{
						font-size: 22rpx;
					}
				}
			}
		}
		.environment{
			background: #fff;
			padding: 40rpx;
			box-sizing: border-box;
			.environment-title{
				width:128rpx;
				height:45rpx;
				font-size:32rpx;
				font-family:PingFangSC-Medium,PingFang SC;
				font-weight:500;
				color:rgba(38,66,114,1);
				line-height:45rpx;
				margin: 40rpx 0;
			}
			.environment-img{
				height: 492rpx;
				margin: 40rpx auto;
			}
			.environment-banner{
				width:100%;
			}
		}
		.apply{
			padding: 60rpx;
			box-sizing: border-box;
			background: #fff;
			.apply-title{
				font-size:36rpx;
				font-family:PingFangSC-Semibold,PingFang SC;
				font-weight:600;
				color:rgba(49,89,143,1);
			}
			.form-item{
				display: flex;
				align-items: center;
				margin: 30rpx 0;
				color: #31598F;
				padding: 20rpx;
				box-sizing: border-box;
				background: #efefef;
			}
			.form-item-select{
				width: 450rpx;
				display: flex;
				justify-content: space-around;
				align-items: center;
			}
			.submit{
				color: #fff;
				height: 100rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				background:rgba(13,56,110,1);
				border-radius:4px;
			}
		}
		.footer{
			width: 100%;
			height: 200rpx;
			line-height: 200rpx;
			text-align: center;
			background: #fff;
			.footer-img{
				width: 400rpx;
				height: 100rpx;
			}
		}
	}
	// <text class="bottom-item-time">8:00am.to9:00am</text>
	// <text class="bottom-item-en">Morming Recepition</text>
	// <text class="bottome-item-name">哈罗空间 :基本照护/自我料理/自我生活 </text>
	
	
	.timetable-bottom{
		padding: 30rpx;
		box-sizing: border-box;
		width: 100%;
		display: flex;
		color: #fff;
		background: #fff;
		.bottom-item{
			padding: 20rpx;
			box-sizing: border-box;
			font-size: 24rpx;
			width: 300rpx;
			height: 200rpx;
			display: flex;
			flex-direction: column;
			.bottom-item-time{
				font-size: 26rpx;
			}
			.bottom-item-en{
				font-size: 22rpx;
			}
			.bottome-item-name{
				font-size: 24rpx;
			}
		}
	}
	.uni-input{
		background: #efefef;
	}
</style>
